@extends('admin.frame_layout')
<?php $top_selected = "系统设置";$page_menu = "网站基本信息配置" ?>
@section('content')
    <div class="formbody">
        <div class="formtitle"><span>基本信息设置</span></div>
        <form action="{{route('admin.basic.save')}}" method="post" id="site">
            {!! csrf_field() !!}
            <ul class="forminfo">
                {!! inputText("公司名称", "kv_basic_name", "text",
                    cache('kv_basic_name'),
                    "名称最长不要超过100个字符！") !!}
                {!! inputText("公司地址", "kv_basic_addr", "text",
                    cache('kv_basic_addr'),
                    "名称最长不要超过100个字符！") !!}
                {!! inputText("公司备案号", "kv_basic_provide", "text",
                   cache('kv_basic_provide'),"",
                   "名称最长不要超过100个字符！") !!}
                {!! inputText("工信部网站", "kv_basic_url", "text",
                   cache('kv_basic_url'),
                   "名称最长不要超过100个字符！") !!}
                {!! inputText("联系电话", "kv_basic_telephone", "text",
                   cache('kv_basic_telephone'),
                   "名称最长不要超过20个字符！") !!}
                {!! inputText("邮箱", "kv_basic_email", "text",
                   cache('kv_basic_email'),
                   "名称最长不要超过50个字符！") !!}
                {!! inputText("寄语", "kv_basic_number", "text",
                   cache('kv_basic_number'),
                   "严格填写！") !!}
                <li>
                    <label class="lable">&nbsp;</label>
                    <input type="submit" class="btn" value="确认保存"/>
                </li>
            </ul>
        </form>
    </div>
@endsection
@section('footer')
    <script>
        $("#site").validate({
            errorPlacement: function (error, element) {
                $(element).closest("form").find("i[for='" + element.attr("id") + "']").html(error);
            },
            submitHandler: function (form) {
                $(form).ajaxSubmit({
                    dataType: "json",
                    type: "post",
                    success: function (data) {
                        if (data.code == 0) {
                            toastr["success"](data.msg);
                            setInterval(function () {
                                window.location.reload();
                            }, 2000);
                        } else {
                            toastr["error"](data.msg);
                        }
                    }
                });
            }
        });
    </script>
@endsection
